package com.infinitus.autocatlog.service;

import java.io.Serializable;
import java.util.Set;

public interface RedisService {

	/**
	 * 批量删除对应的value
	 * 
	 * @param keys
	 */
	public abstract void remove(String... keys);

	/**
	 * 批量删除key
	 * 
	 * @param pattern
	 */
	public abstract void removePattern(String pattern);

	/**
	 * 删除对应的value
	 * 
	 * @param key
	 */
	public abstract void remove(String key);

	/**
	 * 判断缓存中是否有对应的value
	 * 
	 * @param key
	 * @return
	 */
	public abstract boolean exists(String key);

	/**
	 * 读取缓存
	 * 
	 * @param key
	 * @return
	 */
	public abstract String get(String key);

	/**
	 * 写入缓存
	 * 
	 * @param key
	 * @param value
	 * @return
	 */
	public abstract boolean set(String key, Object value);

	/**
	 * 写入缓存
	 * 
	 * @param key
	 * @param value
	 * @return
	 */
	public abstract boolean set(String key, Object value, Long expireTime);

	public abstract boolean sadd(String key, Object... values);

	public abstract boolean contains(String key, Object value);
	
	public abstract boolean expire(String key, Long expireTime);

	public abstract Set<Object> smembers(String key);

	public boolean lpush(String key, Object value);

	public boolean rpush(String key, Object value);

	public Set<Serializable> keys(String pattern);

}